home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
source
/
zendisk2
/
lst13-3.asm
< prev
next >
Wrap
Assembly Source File
|
1990-02-15
|
1KB
|
53 lines
;
; *** Listing 13-3 ***
;
; Tests whether several characters are in the set
; {A,Z,3,!} by using the compare-and-jump approach,
; branching each time a match isn't found.
;
jmp Skip
;
; Determines whether a given character is in the set
; {A,Z,3,!}.
;
; Input:
; AL = character to check for inclusion in the set
;
; Output:
; Z if character is in TestSet, NZ otherwise
;
; Registers altered: none
;
CheckTestSetInclusion:
cmp al,'A' ;is it 'A'?
jnz CheckTestSetZ
ret ;yes, we're done
CheckTestSetZ:
cmp al,'Z' ;is it 'Z'?
jnz CheckTestSet3
ret ;yes, we're done
CheckTestSet3:
cmp al,'3' ;is it '3'?
jnz CheckTestSetEx
ret ;yes, we're done
CheckTestSetEx:
cmp al,'!' ;is it '!'?
ret ;the success status is already in
; the Zero flag
;
Skip:
call ZTimerOn
mov al,'A'
call CheckTestSetInclusion ;check 'A'
mov al,'Z'
call CheckTestSetInclusion ;check 'Z'
mov al,'3'
call CheckTestSetInclusion ;check '3'
mov al,'!'
call CheckTestSetInclusion ;check '!'
mov al,' '
call CheckTestSetInclusion ;check space, so
; we've got a failed
; search
call ZTimerOff